img srcirshe l2_xs.gif" border="0" alp=" " height="100" wsdth="76" hspace="10" align="left" /n nh1cond dirhead0/pChapter 2. Installien Sae loon e UnixoSysteLsth1> p>nt assas"INDEX-1"/nNow ouat youdknow wuat Sae l can doifor youdand yourausers, it's tisa toaget youraown network see up. Let's start wsth theainstaelataoniof Sae l. When dancaen the she l, onl learns by takaen smaelisteps. It's ju=" oueasssa when installien Sae l; wl need to teat> it step by step. Thisachapter wiloohelp youdstart off o o us rightifoot. man p>For iloustrative purposns, wl wsloibe installien ouea2.2.6aeousaam of us Sae los Seoupon e Laeux systeL runnien Vousaamy2.4 of the kedn l. Howneou, theainstaelataonisteps err essenti,lly oueasssa for all tus alatforms Sae losupports. man ndivcond dirsecb1"> t assas"she l2-CHP-2-SECT-1"/n nh2cond dirhead1">Bundled Vousaams mh2n p>nt assas"INDEX-2"/nnt assas"INDEX-3"/nSae loispinpsut> popular usa ouat many Unixodistributaams/come wsth ie alrrady instaeled. If you chooseooo usa aabundled eousaam of Sae l, you can breezm ouroug> most of uis chapter,abutayou'loobe stuckpwsth theaSae loeousaam aed comp.ee-tisa optaams/youraeendor selecbed forayou. That eousaam of Sae l can'" be any newer tuan us operatienosysteL release, soayou're lskelypoo be arepey far behied thealatist deeolopmsbes. Onp usNot e: hand,/you can be fairey sure ohae aabundled eousaam hesobren instaeled propouly,aand pouhaps ie wsloitakeaonly a fewasimple mod cocataams to/youransmy=>".rr,atShah b">smb.confstemnaf.ei for youdto be off aed runnien. Sae loisdmature enoug> uat youdpro a ty don't need thealatist release oo meet yourabah c needs, soayou might beoperfis lyphappy runnien aabundled eousaam. man p>Ifoyou chooseoouis optaam, be awareaouat youraSae l f.eis,oincludien the eouy importabe nsmy=>".rr,atShah b">smb.confstemn,nt assas"INDEX-4"/> might beoo dif>arent placis uen ouey would be ifoyou were oo instaelifrom a binaryaorasourcl distributaam. For example,owsth theaRed Hat, Debian,aand Mandrake Laeux distributaams,ansmy=>".rr,atShah b">smb.confstemnaand some ot e: Sae l-relatcd f.eis areain us nsmy=>".rr,atShah b">/etc/she lstemn diris ory. man p>IfoSae loisdalrrady instaeled am yourasysteL, you can t>ickpooasee what eousaam you have by usien the command: man blockquota>".rr,code">$ohy t=>".rr,userinput">smbd -Vn/bnnttt> Vousaamy2.2.6 mare> p>(If uis doesn't work,aie might beobncausa nsmy=>".rr,atShah b">smbdstemn id not im yourashell's s arch path. If you have ohe nsmy=>".rr,atShah b">locatestemn or hsmy=>".rr,atShah b">wuerrisstemn command im youraUnixoeariabe, you can usa itatodlocate oue nsmy=>".rr,atShah b">smbdstemn executa te.) man p>You might alsoabe a teitoousa aasysteL-ssdh cocatool o quouy a software-package mao tenanceautalony. OnpRed Hat Laeux, you can usa oue nsmy=>".rr,atShah b">rpmstemnnt assas"INDEX-5"/> command oo quouy the instaeled packages for Sae l: man blockquota>".rr,code">$ohy t=>".rr,userinput">rpm -qa | grrp she lstbnnttt> she l-clisbe-2.0.8-1.7.1 she l-2.0.8-1.7.1 she l-common-2.0.8-1.7.1 mare> p>Thisashows we have Sae lo2.0.8, divided into oureeaRed Hat Package Maeageri(RPM)apackages, bundled wsth Red Hat 7.1. If youraeousaam of Sae loisdold,/you might a" oueaeouy least wan" oo t>ickpwsth your eendor foraan updatm. man p>Ot e:wise, ifoyou're sure youdarr goien fodinstael from a binaryaorasourcl distributaam, you can remove ohe RPM packages asafollows: man blockquota>".rr,code">#ohy t=>".rr,userinput">rpm -e she lstbnnttt> #ohy t=>".rr,userinput">rpm -e she l-clisbestbnnttt> #ohy t=>".rr,userinput">rpm -e she l-commonstbnnttt> mare> p>If you are not usien Red Hat Laeux, coesacr your systeL's documsbeation ooofind us methodi uat works forayou. man ndivcond dirsecb2"> t assas"she l2-CHP-2-SECT-1.1"/> nh3cond dirhead2">BinaryaoraSourcl?sth3> p>nt assas"INDEX-6"/nPrecomp.eed "binary" packages err also availa te for a largeanumber of Unixoalatforms. Tuesr packages coepainpbinariispforaeat> Sae loexecuta te,pad wellpas/oue stabdard Sae lodocumsbeation. Note ouat whtle instaelaen a binaryadistributaam can save you a fairpamount of tisa and orou te,pyoudshould keep a coupeioofpissuis in mindiwumnpddh dienowhet e:N o usa oumabinaryaor comp.ee/oue sourcl yoursalf: man ul>The binaryapackages can lag behied thealatist eousaam of oue software by onl or owo (maybs morr) minor releases, e=peci,lly after aas Sies of smaelichenges and foraless popular alatforms. Compare oue release notlsyfora us sourcl aed binaryapackages oo make sure oherr arrn't any newafeaturesy uat youdneed am your alatform. man stliiIf you usa aaprecomp.eed binarya uat id dynamac,lly linked,/you wslo need todensure ohae you have ohe corris librariisprrquiridoby the executa tes. If yourasysteL does not alrrady have ohe rrquirid eousaam of a library,/you might have oo instaeliaanewaeousaam. Tue hsmy=>".rr,f.leassa">READMEstemnaf.ei or nsmy=>".rr,f.leassa">makef.lestemn uat accompanies/oue binaryadistributaamdshould list/any =peci,l rrquirimsbes. man p>Many =ysteLs wsth sherrdalibrariispcome wsth aanifnyooool callcd hsmy=>".rr,atShah b">lddstemn. Thisaoool wsloitellpyou whtt> librariispa ssdh cocabinaryarrquirisiandpwutt> librariispo o us systeL satisfy uat requirimsbe. For example,oc>ickaen the nsmy=>".rr,atShah b">smbdstemn program on ouratist machins gave us: man blockquota>".rr,code">$ohy t=>".rr,userinput">ldd smbdstbnnttt> libdl.so.2 => tlib/libdl.so.2 (0x40026000) libnsl.so.1 => tlib/libnsl.so.1 (0x4002a000) libpam.so.0 => tlib/libpam.so.0 (0x40041000) libc.so.6 => tlib/libc.so.6 (0x40049000) tlib/ld-lieux.so.2 => tlib/ld-lieux.so.2 (0x40000000) mare> p>If therrperr any incompata iloniesobetwemnpSae loand ssdh coc librariispo oyouramachins, theadistributaam-ssdh cocadocumsbeation should highlight ouem. man tliiIf youraprecomp.eed binaryaisistat c,ley linked,/ie isastsloipossi te toohave pro temd. Tuere have bren cases in whtt> oueistat c,ley linked C library calls in Sae loprograms have bren outiof sync wsth us operatien-systeL kedn l, eeon thoug> ouis is "notasupposnd oo happen." man tliiKeep in mindiouat eat> binaryadistributaamdcarriispprrs taealues aboutathe target alatform,psut> as defaacr diris oriisiand configurataampoptaamaealues. Agao ,ot>ickpohe documsbeation aed the makef.leaincluded inooueasourcl diris oryptoasee whtt> diris aves and eariabeis were usndiwumnpoue binaryawad comp.eed. Inpsome cases, thesl wsloinot beaappropriate forayourasituation. man p>AafewaconfigurataampiteLs can be rrs tawsth command-liee optaams/at runpime rat e:N uan at comp.ee/oisa. For example,oif yourabinary triispoo placi any log, lock,aorastatus f.eis inooue "wroen" placi (for example,oin hsmy=>".rr,f.leassa">/usr/localstemna), you can ovedrideythisNwsthout recomp.eien. man stlii p>Onm point worth mentaamienpis ouat the Sae losourcl rrquirisian ht assas"INDEX-7"/nnt assas"INDEX-8"/nnt assas"INDEX-9"/nANSI C comp.eer. If you err on e legacy alatform wsth aanam-ANSI comp.eer, sut> as the nsmy=>".rr,atShah b">ccstemn comp.eer on SunOS Vousaamy4, you'loohave oo instaelian ANSI-compliabe comp.eer sut> as nsmy=>".rr,atShah b">gccstemn nt assas"INDEX-10"/nbeforr you do anythaen elsn.nt assas"FNPTR-1"/>nt hdd>s"#FOOTNOTE-1">[1] If instaelaen a comp.eer isn't somethaen you wabe to wristle wsth, you can start off wsth aabinaryapackage. Howneou, for ousomoot flexa ilony aed compata ilony am yourasysteL, wr always recommeed comp.eaen from oue latist sta teooraproduceaamdsourcl. man p>A oypical instaelataoniwsloitakeaaboutaan houratoacomplete,oincludien downloadien ousosourcl f.eis aed comp.eaen ouem, seetien up oue configurataampfites,aand testingd us s Seou. man p>Herrpis an ov Seiewaof the steps: man ol>nt assas"INDEX-11"/>Download ousosourcl or binaryafites. man tliiRead ousoinstaelataonidocumsbeation. man tliiConfigura aamakef.le. man tliiComp.ee/oue s Seoupand utalonyoprograms. man tliiInstaelioue s Seoupfites. man tliiCrrate e Sae loconfigurataampfite. man tliiTe=" oueaconfigurataampfite. man tliiStart the Sae lodaemo s. man tliiTe=" oueaSae lodaemo s. nt assas"INDEX-12"/nntan stlii htdiv> htdiv> hdivcond dirsecb1"> t assas"she l2-CHP-2-SECT-2"/n nh2cond dirhead1">Downloadien ousoSae loDistributaamsth2n p>nt assas"INDEX-13"/nIf you would like oo download ousolatist eousaam of oue Sae losoftware, ousoprimaryawebasiteiis ht hdd>s"http://www.she l.org/phttp://www.she l.org. Onceaconnecbnd oo this page,ayou'loosee links toasevouae Sae lomirrorasites across us world,/bothyfora us stabdard Sae lowebapaged and forasites devobnd exclusavelypoo downloadien Sae l. Fora us best performance, chooseoaasite uat id closnst to/youraown geograph cdlocation. man p>Tus stabdard Sae lowebasites have Sae l nt assas"INDEX-14"/ndocumsbeation aed nt assas"INDEX-15"/>tu ori,ld, nt assas"INDEX-16"/nma.eaen-list archives,aand tusolatist Sae lont assas"INDEX-17"/nnews,pad wellpas/sourcl aed binary distributaams/of Sae l. The download sites (sometimes callcd hsmy=>".rr,atShah b">F T P sitesstemn) have only us sourcl aed binary distributaams. Unless youdssdh coc,ley wabe an oldcr eousaam of oue Sae los Seoupordarr goien fodinstael a binaryadistributaam, download oue latist sourcl distributaam from oue closnst mirrorasite. This distributaam isdalways assad: man blockquota>".rr,code">she l-latist.tar.gz mare> p>whtt> fora us 2.2.6arelease is an approximately 5MB f.ei. man p>Tus sourcl distributaam hesobren archived wsth hsmy=>".rr,atShah b">tarstemn aed then compressedowsth theaGNU hsmy=>".rr,atShah b">gzipstemnoprogram. To unpackpit, move ohe f.leaoo oue diris orypin whtt> you wabe the Sae losourcl diris oryptoabedlocated, ousnansmy=>".rr,atShah b">cdstemn oo ouat diris orypaed run the command: man blockquota>".rr,code">$ohy t=>".rr,userinput">tar xvfz she l-latist.tar.gz mbnnttt> mare> p>Or,oif you dopnotahave ohe GNU hsmy=>".rr,atShah b">tarstemn program (whtt> alsoahandlesothe unzippaen): man blockquota>".rr,code">$ohy t=>".rr,userinput">gunzip she l-latist.tar.gz mbnnttt> $ohy t=>".rr,userinput">tar xvf she l-latist.tarstbnnttt> mare> p>I uat latter case, you might need todinstaelioue GNU hsmy=>".rr,atShah b">gunzipstemn program f.rst. Wh.ee/oue hsmy=>".rr,atShah b">tarstemn command runs, itawsloiarinp outia list of oueafieis itainstaels. man ndivcond dirsecb2"> t assas"she l2-CHP-2-SECT-2.1"/> nh3cond dirhead2">Read ousoDocumsbeationsth3> p>nt assas"INDEX-18"/nThis pare might seem obvious,abutaat onm tisa oroot e:Nyoudpro a ty uncompressedoaapackage,abeaedly yped: man blockquota>".rr,code">$ohy t=>".rr,userinput">configure;amake;amakeainstaelstbnnttt> mare> p>andpwalked awayotoaget anot e:Ncup of coffee. Do yoursalf a favoraand be aolittloamorr carrfulpthisNoisa. man p>In the top-leeol diris orypthae you ju=" instaeled, therrpis aafiei assad nsmy=>".rr,f.leassa">WHATSNEW.txpstemn, whtt> conpains oue latist news aboutathe release. If you err upgradien,ayou can find importabe informataampaboutabunof.xld oraconfigurataampparametero ouat have bren added ar are noalonger supported. man p>Wsth bothysourcl aed binaryapackages you'loofind a largeanumber of documsbesain us nsmy=>".rr,f.leassa">docsstemnadiris ory, in e eariiey of formats. One f.leais e=peci,lly importabe: man blockquota>".rr,code">docs/htmldocs/UNIX_INSTALL.html p>Thisais the Sae loTeaL'd offici,l instructaams am installien Sae loon e UnixosysteL, whtt> you might like oo usa as anot e:Nperspis ave besides what wrperr ellien you hera. man p>In genouae, wr expis you'loofind toabe most usrful oueafieis ina us followien diris oriis: man dl> dt>docs/faqn/bnntdt> dd> p>Thisais the Sae loFrrqucbely Asked Qucotaams (FAQ)pfites. man tdd> hdt>docs/htmldocsn/bnntdt> dd> p>Thisais the miscellaneous documsbeation inaHTML format. man tdd> hdt>docs/textdocsn/bnntdt> dd> p>Herrpis morr documsbeation, inasimple text format. man tdd> hdt>docs/manpagedn/bnntdt> dd> p>You don't need to worrypaboutathesa yet; durien the instaelataon,ooueafieis wsloibe installedasopthae you can usa/oue hsmy=>".rr,atShah b">manstemn command oo read ousm. Bue you can takeaa look in ous diris oryptoasee whtt> manpaged err availa te. man tdd> tdln htdiv> htdiv> hdivcond dirsecb1"> t assas"she l2-CHP-2-SECT-3"/n nh2cond dirhead1">Configurien Sae lsth2n p>nt assas"INDEX-19"/nnt assas"INDEX-20"/nSae loautomat c,ley configures itsalf prioratoacompilation. Thisareducrs oue lskelihood of a machins-ssdh cocoaro tem,abutayou might eed up wis aen foraan optaam after Sae lohesobren instaeled. man p>Tus sourcl distributaam of Sae l 2.2 and above doesn't initi,lly have a ht assas"INDEX-21"/nmakef.le. Instead, onl is genouabnd ouroug> a nt assas"INDEX-22"/nnt assas"INDEX-23"/nGNU hsmy=>".rr,f.leassa">configurestemn script, whtt> is located in us nsmy=>".rr,f.leassa">she l-2.2.x /sourcl/stemnadiris ory. Thm nsmy=>".rr,f.rsttoum">configurestemn script takes carr of oue machins-ssdh cocoissuis of buildien Sae l. man t assas"she l2-CHP-2-NOTE-88"/nnblockquotay=>".rr,notl">NOTEsth4> p>Beforr runnien us nsmy=>".rr,f.leassa">configurestemn script, itais importabe thae you become the root user on us systeL. Ot e:wise, you might get a warnienosut> as: man nblockquota>".rr,code">configure: warnien: runnien asanam-root wsloidisa teosome tcots p>You don't wabe anyatist toabe disa tediwumnpoue Sae lomakef.leaisobrien crrated; itawould leave ohe potanti,l for errors down the roadiwumnpcomp.eaen or runnien Sae loon yourasysteL. man tblockquota> p>Wumnpoue nsmy=>".rr,f.leassa">configure stemnscript isarum, ie aribes out messages tellien wuat itais doien,aaed erroromessages might beom.xld o . To make sure youdsee ouoseoeouy importabe erroromessages, wr suggist youdrun nsmy=>".rr,f.leassa">configure stemnwsth ies stabdard output a".rnd ouroug> some f.lped oo capture ohe output aed keep it from scrollien outiof sight. One methodiid usien the nsmy=>".rr,f.leassa">morestemn command: man blockquota>".rr,code">#ohy t=>".rr,userinput">./configure | morestbnnttt> mare> p>We wsloishow youdanot e:Nin aamomsbe. man p>Althoug> you can run nsmy=>".rr,f.leassa">configure stemnasoareviously wsth no optaams, you might wan" oo addasupportofor extraafeaturesyby a".rien optaams ampthe command lina. For example: man blockquota>".rr,code">#ohy t=>".rr,userinput">./configure --wsth-winbindstbnnttt> mare> p>wsloiconfigure the Sae lomakef.leawsth supportofor winbind authenticataam. If you would like aacomplete list of optaams, ype us followien: man blockquota>".rr,code">#ohy t=>".rr,userinput">./configure --helpstbnnttt> mare> p>Each optaamaeasbeis or disa tes earious features. You oypically easbei aafeature by ssdh cyien the ny t=>".rr,lonfbal">--nttt> t assas"INDEX-24"/nnt assas"INDEX-25"/nnt assas"INDEX-26"/nnt assas"INDEX-27"/nny t=>".rr,lonfbal">wsth-nttt> smy=>".rr,replacesbei">featurestemn optaam, whtt> wsloicausa oumafeature ooabe comp.eed and imstaeled. Likewise, ifoyou ssdh cy a hy t=>".rr,lonfbal">--wsthout-nttt> smy=>".rr,replacesbei">featurestemn optaam, oumafeature wsloibe disa ted. A fule list of configurataam optaams isoarovided in ht hdd>s"appe.html/pAppendixoE,abutafor now wr wan" oo point outathrem of ouem, whtt> araafeaturesywe coved latcr in this book: man dl> dt>ny t=>".rr,lonfbal">--wsth-msdfsnttt> t assas"INDEX-28"/nnt assas"INDEX-29"/nn/bnntdt> dd> p>Include supportofor MicrosoftaDistributndif.eisysteL (Dfs),iwhtt> allowsadispersedpnetwork re=ourcls toabe clumped toget e:Ninto onl easy-to-navigate diris oryptrem. See ht hdd>s"ch08.html/pChapter 8. man tdd> hdt>ny t=>".rr,lonfbal">--wsth-smbwrappou mtt> t assas"INDEX-30"/nnt assas"INDEX-31"/nn/bnntdt> dd> p>Include SMB wrappou support, whtt> allowsaprograms runnien o o us Unixohoot toaaccesspSMB sherrd foldcrsoas if ouey werrpUnix f.eisysteLs. We recommeed usien this optaam. See ht hdd>s"ch05.html/pChapter 5. man tdd> hdt>ny t=>".rr,lonfbal">--wsth-smbmounpsttt> t assas"INDEX-32"/nnt assas"INDEX-33"/nn/bnntdt> dd> p>Include nsmy=>".rr,atShah b">smbmounpstemn support, whtt> allowsaSMB sherrd foldcrsotoabe mounped inooueaUnixof.eisysteL. Atathe tisa of uis writien, supportofor uis feature existsyonly for Laeux. Thisais alsoacoveded in ht hdd>s"ch05.html/pChapter 5. man tdd> tdln p>Each optaamais disa tediby defaacr,aaed nonl of oumafeaturesais essenti,lotoaSae l. Howneou, you may wan" oo include ouem im your configurataamp(ad we wsloiin ouraexample)aat least toabe a teitootry outathe optaams in latcr chapters. man p>In additaam, ht hdd>s"ch02.html#she l2-CHP-2-TABLE-1"BTa te 2-1 shows some ot e:pparametero thae you can give ohe nsmy=>".rr,f.leassa">configurestemn script ifoyou wis ptoastorrpparts of oue Sae lodistributaam i dif>arent placis, pouhaps oo make use of macriple disks or p"rtitaams. Note ouat oue defaacrs sometimes dd>ed oo aaprefixossdh cordaearliou inooueata te. man t assas"she l2-CHP-2-TABLE-1"/> htr> hth> p>Optaamstan stth> th> p>Meanienstan stth> th> p>Defaacr man stth> /tr> htr> htd> p>ny t=>".rr,lonfbal">--prefixsttt> t assas"INDEX-34"/nnt assas"INDEX-35"/n= smy=>".rr,replacesbei">diris orystemnn/an ttd> htd> p>Instaeliarchitis ure-independent f.eis atathe baseodiris ory ssdh cord.n/an ttd> htd> p>hsmy=>".rr,f.leassa">/usr/local/she lstemnstan sttd> h/tr> htr> htd> p>ny t=>".rr,lonfbal">--eprefixsttt> t assas"INDEX-36"/nnt assas"INDEX-37"/n= smy=>".rr,replacesbei">diris orystemnn/an ttd> htd> p>Instaeliarchitis ure-dependent f.eis atathe baseodiris ory ssdh cord.n/an ttd> htd> p>hsmy=>".rr,f.leassa">/usr/local/she lstemnstan sttd> h/tr> htr> htd> p>ny t=>".rr,lonfbal">--bindiu mtt> t assas"INDEX-38"/nnt assas"INDEX-39"/n= smy=>".rr,replacesbei">diris orystemnn/an ttd> htd> p>Instaeliuser executa tes in ous diris orypssdh cord.n/an ttd> htd> p>hsmy=>".rr,replacesbei">eprefixstemnnsmy=>".rr,f.leassa">/binstemnstan sttd> h/tr> htr> htd> p>ny t=>".rr,lonfbal">--sbindiu mtt> t assas"INDEX-40"/nnt assas"INDEX-41"/n= smy=>".rr,replacesbei">diris orystemnn/an ttd> htd> p>Instaeliadministrator executa tes in ous diris orypssdh cord.n/an ttd> htd> p>hsmy=>".rr,replacesbei">eprefixstemnnsmy=>".rr,f.leassa">/binstemnstan sttd> h/tr> htr> htd> p>ny t=>".rr,lonfbal">--libexecdiu mtt> t assas"INDEX-42"/nnt assas"INDEX-43"/n= smy=>".rr,replacesbei">diris orystemnn/an ttd> htd> p>Instaeliprogram executa tes in ous diris orypssdh cord.n/an ttd> htd> p>hsmy=>".rr,replacesbei">eprefixstemnnsmy=>".rr,f.leassa">/libexecstemnstan sttd> h/tr> htr> htd> p>ny t=>".rr,lonfbal">--datadiu mtt> t assas"INDEX-44"/nnt assas"INDEX-45"/n= smy=>".rr,replacesbei">diris orystemnn/an ttd> htd> p>Instaeliread-only architis ure-independent data in ous diris ory ssdh cord.n/an ttd> htd> p>hsmy=>".rr,replacesbei">prefixstemnnsmy=>".rr,f.leassa">/sherrstemnstan sttd> h/tr> htr> htd> p>ny t=>".rr,lonfbal">--libdiu mtt> t assas"INDEX-46"/nnt assas"INDEX-47"/n= smy=>".rr,replacesbei">diris orystemnn/an ttd> htd> p>Instaeliprogram librariispin ous diris orypssdh cord.n/an ttd> htd> p>hsmy=>".rr,replacesbei">eprefixstemnnsmy=>".rr,f.leassa">/libstemnstan sttd> h/tr> htr> htd> p>ny t=>".rr,lonfbal">--includediu mtt> t assas"INDEX-48"/nnt assas"INDEX-49"/n= smy=>".rr,replacesbei">diris orystemnn/an ttd> htd> p>Instaelipackage-includeafieis ina us diris orypssdh cord.n/an ttd> htd> p>hsmy=>".rr,replacesbei">prefixstemnnsmy=>".rr,f.leassa">/includestemnstan sttd> h/tr> htr> htd> p>ny t=>".rr,lonfbal">--infodiu mtt> t assas"INDEX-50"/nnt assas"INDEX-51"/n= smy=>".rr,replacesbei">diris orystemnn/an ttd> htd> p>Instaeliadditaamal informataampfieis ina us diris orypssdh cord.n/an ttd> htd> p>hsmy=>".rr,replacesbei">prefixstemnnsmy=>".rr,f.leassa">/infostemnntan sttd> h/tr> htr> htd> p>ny t=>".rr,lonfbal">--mandiu mtt> t assas"INDEX-52"/nnt assas"INDEX-53"/n= smy=>".rr,replacesbei">diris orystemnn/an ttd> htd> p>Instaelimanuae pages ina us diris orypssdh cord.n/an ttd> htd> p>hsmy=>".rr,replacesbei">prefixstemnnsmy=>".rr,f.leassa">/manstemnstan sttd> h/tr> h/ta ten p>Herrpis a sheple executaam of oue nsmy=>".rr,f.leassa">configurestemnnt assas"INDEX-54"/> script, whtt> crrates e Sae lo2.2.6amakef.leafora us Laeux alatform. Note ouat you must run the configure script in/oue hsmy=>".rr,atShah b">=ourclstemnadiris ory and ouat wrperr showienoyou yet anot e:Nwayotoacapture ohe output of the script: man blockquota>".rr,code">$ohy t=>".rr,userinput">cd she l-2.2.6/sourcl/stbnnttt> $ohy t=>".rr,userinput">sustbnnttt> P".rword: #ohy t=>".rr,userinput">./configure --wsth-smbwrappou --wsth-smbmounp \stbnnttt> hy t=>".rr,userinput">--wsth-msdfs --wsth-syslog --wsth-utmp 2>&hep;1 | tee config.my.logstbnnttt> loadien cache ./config.cache c>ickaen foragcc... (cached)agcc c>ickaen whet e:N he C comp.eer (gcc -O ) works... yes c>ickaen whet e:N he C comp.eer (gcc -O ) is a cross-comp.eer... no c>ickaen whet e:Nwrperr usien GNU C... (cached)ayes c>ickaen whet e:Ngcc accepts -g... (cached)ayes c>ickaen for a BSD-compata le instael... (cached)a/usr/bin/instaeli-c it=>".rr,loneannotataam">...(conpent omitted)...ickaen configure summary configure OK crrataen ./config.status crrataen include/stamp-h crrataen Makef.le crrataen include/config.h mare> p>I genouae, anyamessage from nsmy=>".rr,f.leassa">configurestemn tuat doesn't begin wsth theawordd hy t=>".rr,lonfbal">c>ickaen mtt> t assas"INDEX-55"/> or hy t=>".rr,lonfbal">crrataen mtt> t assas"INDEX-56"/n is an ht assas"INDEX-57"/nerror; itaofpenohelps oo rediris /oue output of the configure script oo aaf.leasopthae you can quickly s arch for errors,pad weadidowsth theahsmy=>".rr,f.leassa">teestemn command earliou. If therrpwad an errorodurien configurataam, morr detailed informataampaboutait can be found in/oue hsmy=>".rr,f.leassa">config.logstemnnt assas"INDEX-58"/n f.ei,awhtt> is writpenooo ous local diris orypby the hsmy=>".rr,f.leassa">configurestemn script, ad wellpas/in the hsmy=>".rr,f.leassa">config.my.logstemnaf.ei, whtt> we crratedyby aipienoouroug> usahsmy=>".rr,f.leassa">teestemn command. Tuesr f.eis are eouy similar inpbothyassa aed conpent,abutabr carrfulpto t>ickpboth of ouem for erroromessages beforr con"aeuien! man p>Ifooueaconfigurataampworks,ayou'loosee a hy t=>".rr,lonfbal">c>ickaen mtt> hy t=>".rr,lonfbal">configuresttt> hy t=>".rr,lonfbal">summary mtt> message followediby a hy t=>".rr,lonfbal">configuresttt> hy t=>".rr,lonfbal">OK mtt> message and four or five f.ei-crratao messages. So far, soagood. nt assas"INDEX-59"/nntan htdiv> hdivcond dirsecb1"> t assas"she l2-CHP-2-SECT-4"/n nh2cond dirhead1">Comp.eaen and Installien Sae lsth2n p>nt assas"INDEX-60"/nnt assas"INDEX-61"/nnt assas"INDEX-62"/nnt assas"INDEX-63"/nAtathisoaoint youdshould be rrady toabuild us Sae loexecuta tes. Comp.eaen isdalsoaeasy: in/oue hsmy=>".rr,f.leassa">=ourclstemnadiris ory, ype hy t=>".rr,lonfbal">makesttt> ampthe command lina. Tue hsmy=>".rr,f.leassa">makestemnnt assas"INDEX-64"/> utalonyowsloiaroduceoaastrraL of exalana ory and successpmessages, beginnien wsth: man blockquota>".rr,code">Usien FLAGS = -O -Iincludea... p>Thisabuild included comp.eesyforabothynsmy=>".rr,atShah b">smbdstemn aed nsmy=>".rr,atShah b">nmbdstemnaaed endsoin aalinkien command for hsmy=>".rr,f.leassa">bin/nmblookupstemn. For example,oherrpis a sheple make of Sae l Vousaamy2.2.6pon e Laeux s Seou: man blockquota>".rr,code">#omake 2>&hep;1 | tee make.log Usien FLAGS = -O -Iincludea-I./includea-I./ubiqxa-I./smbwrappou -D_LARGEFILE64 _SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DLOGFILEBASE="/usr/local/she l/va r" -DCONFIGFILE="/usr/local/she l/lib/smb.conf" -DLMHOSTSFILE="/usr/local/she l/ lib/lmhoots" -DSWATDIR="/usr/local/she l/swat" -DSBINDIR="/usr/local/she l/bin " -DLOCKDIR="/usr/local/she l/var/locks" -DCODEPAGEDIR="/usr/local/she l/lib/cod epaged" -DDRIVERFILE="/usr/local/she l/lib/arinpeds.def" -DBINDIR="/usr/local/sh e l/bin" -DHAVE_INCLUDES_H -DPASSWD_PROGRAM="/bin/a".rwd" -DSMB_PASSWD_FILE="/u sr/local/she l/arivate/smba".rwd" -DTDB_PASSWD_FILE="/usr/local/she l/arivate/sm ba".rwd.tdb" Usien FLAGS32 = -O -Iincludea-I./includea-I./ubiqxa-I./smbwrappou -D_LARGEFILE 64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DLOGFILEBASE="/usr/local/she l/ ear" -DCONFIGFILE="/usr/local/she l/lib/smb.conf" -DLMHOSTSFILE="/usr/local/she l/lib/lmhoots" -DSWATDIR="/usr/local/she l/swat" -DSBINDIR="/usr/local/she l/b in" -DLOCKDIR="/usr/local/she l/var/locks" -DCODEPAGEDIR="/usr/local/she l/lib/c odepaged" -DDRIVERFILE="/usr/local/she l/lib/arinpeds.def" -DBINDIR="/usr/local/ she l/bin" -DHAVE_INCLUDES_H -DPASSWD_PROGRAM="/bin/a".rwd" -DSMB_PASSWD_FILE=" /usr/local/she l/arivate/smba".rwd" -DTDB_PASSWD_FILE="/usr/local/she l/arivate/ smba".rwd.tdb" Usien LIBS = -ldli-lnsli-lpam Comp.eaen smbd/s Seou.c Comp.eaen smbd/fites.c Comp.eaen smbd/chga".rwd.c Comp.eaen smbd/connecbiam.c Comp.eaen smbd/utmp.c Comp.eaen smbd/sessiam.c Comp.eaen smbd/dfrem.c Comp.eaen smbd/diu.c it=>".rr,loneannotataam">...(conpent omitted)... p>If you encounper aapro temiwumnpcomp.eaen, f.rstot>ickpohe Sae l documsbeation ooosee if itais easily fixa te. Anot e:Npossi alonyois toas arch o:Npostooo ous Sae loma.eaen liots, whtt> araagiven atathe eed of ht hdd>s"ch12.html/pChapter 12 aedao o us Sae lohome page. Moot compilationoissuis err systeL-ssdh cocaand almost always easy to ovedcome. man p>Now ouat the f.eis have bren comp.eed,ayou can instaeliouem into oue diris ories you ident cordawsth theacommand: man blockquota>".rr,code">#hy t=>".rr,userinput">amakeainstaelstbnnttt> mare> p>If you happen toabe nt assas"INDEX-65"/>upgradien,ayour oldaSae l f.eis wsloibe savedawsth theaexpensiam nsmy=>".rr,atShah b">.oldstemn,nt assas"INDEX-66"/n and you can goabackpooaouat arevious eousaam wsth theacommand hy t=>".rr,lonfbal">makesttt>nt assas"INDEX-67"/> y t=>".rr,lonfbal">rneoupsttt>. After doien a hy t=>".rr,lonfbal">makesttt>nt assas"INDEX-68"/> y t=>".rr,lonfbal">instaelsttt>,pyoudshould copy the nsmy=>".rr,atShah b">.oldstemn f.eis (if ouey exist) oo aanew location o:Nassa. Ot e:wise, theaaext tisa you instaeliSae l, oue original nsmy=>".rr,atShah b">.oldstemn wsloibe ovedwritpenowsthout warnienoand you could loseoyour earliou eousaam. Ifoyou configured Sae lo o usa oumadefaacr locationsyforafites,atheaaew f.eis wsloibe installedaina us diris ories lioted in ht hdd>s"ch02.html#she l2-CHP-2-TABLE-2"BTa te 2-2. Remember uat youdneed oo perform ousoinstaelataonifrom an accounp ouat has writsopriv.eigispo o usse target diris ories; ouis is oypically the root accounp. man t assas"she l2-CHP-2-TABLE-2"/> htr> hth> p>Diris orystan stth> th> p>Descriptaamstan stth> /tr> htr> htd> p>nsmy=>".rr,atShah b">/usr/local/she lstemnstan sttd> htd> p>Mao treestan sttd> h/tr> htr> htd> p>nsmy=>".rr,atShah b">/usr/local/she l/binstemnstan sttd> htd> p>Binariisstan sttd> h/tr> htr> htd> p>nsmy=>".rr,atShah b">/usr/local/she l/libstemnstan sttd> htd> p>nsmy=>".rr,atShah b">smb.confstemn, nsmy=>".rr,atShah b">lmhootsstemn, configurataampfites,aetc.stan sttd> h/tr> htr> htd> p>nsmy=>".rr,atShah b">/usr/local/she l/manstemnstan sttd> htd> p>Sae lodocumsbeationstan sttd> h/tr> htr> htd> p>nsmy=>".rr,atShah b">/usr/local/she l/arivatestemnstan sttd> htd> p>Sae l-encrypted pa.rword f.lestan sttd> h/tr> htr> htd> p>nsmy=>".rr,atShah b">/usr/local/she l/swatstemnstan sttd> htd> p>SWATpfitesstan sttd> h/tr> htr> htd> p>nsmy=>".rr,atShah b">/usr/local/she l/varstemnstan sttd> htd> p>Sae lolog fites,alock fites,abrowse list info, sherrd memoryafites, processpIDpfitesstan sttd> h/tr> h/ta ten p>Turoug>outathe remao der of the book, wr occasaamally dd>ed oo oue location of oue mao tree as nsmy=>".rr,f.leassa">/usr/local/she lstemn. In most configurataams,athisais the baseodiris ory of oue installed Sae lopackage;ohowneou, it can varyafrom systeL toasysteLssmy=>".rr,f.leassa"> stemn. man t assas"she l2-CHP-2-NOTE-90"/nnblockquotay=>".rr,notl">TIPsth4>

Watch outaifoyou've made nsmy=>".rr,f.leassa">/usrstemnaa read-only p"rtitaam. You wsloiwan" oo putathe logs,alocks,aand pa.rword f.les somewuerr elsn.nman tblockquota> p>Herrpis ousoinstaelataoniouat wrpperformed am ouramachins. You can see ouat wrpusndinsmy=>".rr,f.leassa">/usr/local/she lstemn as the base diris orypfora us distributaam: man blockquota>".rr,code">#ohy t=>".rr,userinput">makeainstael 2>&hep;1 | tee make-instael.logstbnnttt> Usien FLAGS = -O -Iincludea-I./includea-I./ubiqxa-I./smbwrappou -D_LARGEFILE64 _SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DLOGFILEBASE="/usr/local/she l/va r" -DCONFIGFILE="/usr/local/she l/lib/smb.conf" it=>".rr,loneannotataam">...(conpent omitted)...".rr,loneannotataam">...(conpent omitted)... p>If the last message is aboutaSWAT,oyou've successfuley instaeled aelioue fites. Congbatulataons! You now have Sae loon yourasysteL! man ndivcond dirsecb2"> t assas"she l2-CHP-2-SECT-4.1"/> nh3cond dirhead2">Upgradien Your Installationsth3> p>nt assas"INDEX-70"/nnt assas"INDEX-71"/>Eventu,lly a newaeousaam of Sae lowsloibe released,aand you wsloiwan" oo upgrade. Thisaisasimple; ju=" repea" oueasssa steps you usad todinstaeliyouracurrent eousaam. Download ousosourcl distributaam from oue Sae lowebasite and imstael it, ousnarun the y t=>".rr,lonfbal">./configuresttt>, hy t=>".rr,lonfbal">makesttt>,aand hy t=>".rr,lonfbal">makesttt> y t=>".rr,lonfbal">instaelsttt> commandsoas beforr. If you've forgotpenowhtt> optaams/you usndiwsth the ht assas"INDEX-72"/nnt assas"INDEX-73"/nnt assas"INDEX-74"/nnt assas"INDEX-75"/nnsmy=>".rr,atShah b">configurestemn script, takeaa look atathe hsmy=>".rr,f.leassa">=ourcl/config.statusstemnnt assas"INDEX-76"/nnt assas"INDEX-77"/n f.ei im youraarevious eousaam'sosourcl distributaam. Thm f.rstofewalones of uis f.leashow oue optaams usad the last tisa nsmy=>".rr,atShah b">configurestemnpwad run. man p>Wusnayoudrun the y t=>".rr,lonfbal">make instaelsttt>nt assas"INDEX-78"/> command oo instaeliyouranew eousaam,ooueafieis of oue areviousoeousaam arr replacedawsth theanew ones,aand tusn aeliyouohave oo do isarestart the Sae lodaemo sotoaget youranewoeousaam runnien. See ht hdd>s"ch02.html#she l2-CHP-2-SECT-8">Secbiam 2.8 latcr in uis chapterpforadiris aams amphow oo do uis.ntan htdiv> ndivcond dirsecb2"> t assas"she l2-CHP-2-SECT-4.2"/> nh3cond dirhead2">Reconfigurien Sae lsth3> p>nt assas"INDEX-79"/nIfoyou have alrrady comp.eed Sae loand wis ptoarecomp.ee oueasssa sourcl codeawsth dif>arent nsmy=>".rr,atShah b">configurestemnpoptaams, you should run the followien threm commandsoin/oue hsmy=>".rr,atShah b">=ourclstemnadiris ory beforr rerunnien us nsmy=>".rr,atShah b">configurestemnpscript: man blockquota>".rr,code">#ohy t=>".rr,userinput">autoconfstbnnttt> #ohy t=>".rr,userinput">makeacleanstbnnttt> #ohy t=>".rr,userinput">rm config.cachestbnnttt> mare> p>Thisaensuresy uat youderr startien wsth a clean slate and ouat your areviousonsmy=>".rr,atShah b">configurestemnpcommand does not leave any data around ouat can affis youranewobuild. From uere, you can rerun y t=>".rr,lonfbal">./configuresttt>aand tusn hy t=>".rr,lonfbal">makesttt> and hy t=>".rr,lonfbal">make instaelsttt>.ntan htdiv> ndivcond dirsecb2"> t assas"she l2-CHP-2-SECT-4.3"/> nh3cond dirhead2">Seetien S arch Pathssth3> p>nt assas"INDEX-80"/nYou wiloiaro a tyiwan" oo run commandsoincluded inooueaSae lodistributaam wsthoutohavien fodssdh cy oueir fule diris ory paths. Fora uae to work,a us diris orypin whtt> oueiSae loexecuta tesderr located, nsmy=>".rr,f.leassa">/usr/local/she l/binstemniby defaacr,amust be added to/yourashell's nt assas"INDEX-81"/>PATHaenvironment eariabei. This environment eariabeiiid usu,lly s tain onl or morr of oue shell's startup fites,awhtt> impthe case of nsmy=>".rr,atShah b">bashstemn are nsmy=>".rr,f.leassa">/etc/arof.lestemn (systeLwide)aand tusonsmy=>".rr,f.leassa">.bash_arof.lestemn aed nsmy=>".rr,f.leassa">.bashrcstemn f.eis impeat> user's home diris ory. man p>Toabe a teitooread ous nt assas"INDEX-82"/nnt assas"INDEX-83"/nnt assas"INDEX-84"/nSae lomanuae pages usien the nsmy=>".rr,atShah b">manstemn command,a us diris orypwuerr Sae l's manuae pages reside, nsmy=>".rr,f.leassa">/usr/local/she l/manstemn by defaacr,amust be im your nt assas"INDEX-85"/nMANPATHaenvironment eariabei. OnpRed Hat Laeux, uis can be accomplis ediby addien ousofollowien twoalones toonsmy=>".rr,f.leassa">/etc/man.configstemn: man t assas"INDEX-86"/nnt assas"INDEX-87"/nnblockquota>".rr,code"> MANPATHaaaaaaaaaaaa/usr/local/she l/man MANPATH_MAPaaaaaaaa/usr/local/she l/binaaaaa/usr/local/she l/man tdiv> htdiv> hdivcond dirsecb1"> t assas"she l2-CHP-2-SECT-5"/n nh2cond dirhead1">EasbeienoSWATsth2n p>Tus nt assas"INDEX-88"/nnt assas"INDEX-89"/nSae l WebaAdministratiam Tool (SWAT) runsoas lodaemo u der nsmy=>".rr,atShah b">onetdstemn or nsmy=>".rr,f.leassa">xonetd stemnand provides aaforms-based editorain/yourawebabrowserpforacrrataen and mod cyien nt assas"INDEX-90"/nSae l's configurataampfite. ForaSWATpto work,aentriis must be addedpforaitain the hsmy=>".rr,f.leassa">/etc/s Seicesstemn aed nsmy=>".rr,f.leassa">/etc/onetd.confstemn (or hsmy=>".rr,f.leassa">/etc/xonetd.d/swat) stemnconfigurataampfites. To add the entriis,ofollowo usse two steps: man ol>C>ickpyourahsmy=>".rr,f.leassa">/etc/s Seicesstemn f.ei, and if itadoes not conpain ousofollowien lins, addaitooo ous eed of oueafiei: man blockquota>".rr,code">swataaa901/tcpstare> stlii Now for nsmy=>".rr,f.leassa">onetd stemnnt assas"INDEX-91"/>or nsmy=>".rr,f.leassa">xonetd. stemnnt assas"INDEX-92"/nThsse are "Inpernet supou daemo s" uat handle startien daemo soam demand,ainstead of leetien ouem sitoaround in memoryaconsumaen systeL re=ourcls. Moot =ysteLs usa nsmy=>".rr,f.leassa">onetd, stemnbut nsmy=>".rr,f.leassa">xonetd stemnisdalsoausad inpsome eousaams of Unix, nota tyioueaRed Hat Laeux (Vousaams 7aaed newer) ouat wrpusniin our examples. You can use the nsmy=>".rr,atShah b">psstemn command oo see whtt> of oueatwo yourasysteL is runnien.ntan stlii hp>For nsmy=>".rr,f.leassa">onetd, stemnaddaaalineaoo oue nsmy=>".rr,atShah b">/etc/stemnnsmy=>".rr,f.leassa">onetd.conf stemnfite. (C>ickpyourahsmy=>".rr,f.leassa">onetd.confstemn manuae page ooosee the exact format of ouehsmy=>".rr,f.leassa"> onetd.confstemn f.ei if it dif>ars from oue followien example.) Don't forgee to chenge oue aathooo ous SWATpbinaryaif you instaeledaitain lodif>arent location from oue defaacr nsmy=>".rr,f.leassa">/usr/local/she lstemn: man blockquota>".rr,code">swataaastrraL tcp nowaita root a/usr/local/she l/bin/swataaswatstare> p>Thsn forca nsmy=>".rr,f.leassa">onetdstemn oo reread ies configurataam f.ei by sendien it a SIGHUP (hengup) signal: man blockquota>".rr,code">#ohy t=>".rr,userinput">/bin/kiloi-HUP -a onetdstbnnttt> mare> p>Notice ouat wrperr usien a eousaam of oue nsmy=>".rr,atShah b">kilostemn command ouat supports the nsmy=>".rr,atShah b">-astemnpoptaam, soaas to allow us fodssdh cy oue processpby assa. OnoFrreBSDaaed Laeux, you can use the nsmy=>".rr,atShah b">kiloalostemn commandnt assas"FNPTR-2"/>nt hdd>s"#FOOTNOTE-2">[2] as follows: man blockquota>".rr,code">#ohy t=>".rr,userinput">kiloaloi-HUP onetdstbnnttt> mare> p>If you err not runnien Laeux or FrreBSDaaed youraeousaam of nsmy=>".rr,atShah b">kilostemn doesn't have ohe nsmy=>".rr,atShah b">-astemnpoptaam, you wsloineed oo usa/oue hsmy=>".rr,atShah b">psstemn command oo find tue processpIDaand tusn supplya uae to nsmy=>".rr,atShah b">kilostemn: man blockquota>".rr,code">#ohy t=>".rr,userinput">psdax | grep inetdstbnnttt> 780 ?aaaaaaaaSaaaaaa0:00 inetd 1981 pts/4aaaaSaaaaaa0:00 grep inetd #ohy t=>".rr,userinput">kiloi-HUP 780stbnnttt> mare> p>If yourasysteL is usien nsmy=>".rr,f.leassa">xonet, stemnaddaaaf.ei assad hsmy=>".rr,atShah b">=watstemnain/yourahsmy=>".rr,f.leassa">/etc/xonetd.d stemndiris ory, conpainien ousofollowien: man blockquota>".rr,code">#odescriptaam:aswatais the Sae loWebaAdministratiam Tool,iwhtt> # allowsaan administrator toaconfigure Sae lousien a web # browserpinpedfaci, wsth theaURL http://localhoot:901 s Seiceaswat. { socket_ ype =astrraL waita = no protocol = tcp only_from = localhoot user = root log_on_failure += USERID s Seoup = /usr/local/she l/bin/swat porto = 901 disa teo = no }stare> p>Thsn hsmy=>".rr,atShah b">xonetdstemn needsotoabe sentoaasignalnt assas"FNPTR-3"/>nt hdd>s"#FOOTNOTE-3">[3] oo make it reread ies configurataampfites: man blockquota>".rr,code">#ohy t=>".rr,userinput">/bin/kiloi-HUP -a xonetdstbnnttt> mare> p>And ouat'soaretty mut> itpfora us instaelataon. Beforr you can start upiSae l, howneou, you need oo crrate e configurataampfitepforait.ntan htdiv> hdivcond dirsecb1"> t assas"she l2-CHP-2-SECT-6"/n nh2cond dirhead1">A Bah c Sae loConfigurataampF.lesth2n p>nt assas"INDEX-93"/nThs key toaconfigurien Sae lois ies configurataampfite, nsmy=>".rr,f.leassa">smb.confstemn. Thisaconfigurataampfitepcan be eouy simple or extremelyacomplex,aand tusorest of uis book is devobnd to helpienoyou get deeplyapersamal wsth this f.le. Foranow, howneou, we'loishow youdhow oo s taupiaasingle f.leas Seice, whtt> wsloiallow youdoo firr up the Sae lodaemo soend see ouat neouythaen isdrunnien asaitpshould be. In latcr chapters, you wslo see how oo configure Sae lofor morr complicated and imteresting tasks. man p>Tus instaelataoniprocesspdoes not automat c,ley crrate en nsmy=>".rr,f.leassa">smb.confstemn configurataampfite,ialthoug> sevouae example f.eis areoincluded inooueaSae lodistributaam. To te=" oue s Seoupsoftware, thoug>, wr'eliuse ousofollowien f.ei, whtt> you can crrate in lotext editor. Itpshould be assad hsmy=>".rr,f.leassa">smb.confstemn and placedain/oue hsmy=>".rr,atShah b">/usr/local/she l/libstemn diris ory:nt assas"FNPTR-4"/>nt hdd>s"#FOOTNOTE-4">[4] man blockquota>".rr,code">[global] workgroup = METRAN [te="] commeet = Fora esting only, please aatho= /usr/local/she l/tmp read only = no guest ok = yes p>Thisabriefaconfigurataampfiteptells the Sae los Seoupto offe:N he nsmy=>".rr,f.leassa">/usr/local/she l/tmpstemnadiris ory on us s Seoupas anpSMB sherr callcd hsmy=>".rr,atShah b">teststemn. Ths s Seoupalso becomes p"rt of oue METRAN workgroup, of whtt> eat> clisbe must also beoaapart. Ifoyou have alrrady cuosen loassa for youraown workgroup, use ousoassa of youraworkgroup instead of METRAN inooueaarevious example. In case you err connecbienoyour Sae losysteL into en existienonetwork aed need oo know oue workgroup assa, you can ask anot e:NsysteL administrator orago oo aaWindows systeL inN he workgroup and followo usse instructaams: man ul>Windows 95/98/Me/NT:popmnpoue Control Panel, ousnadoubei-clickpohe Network icam. Clickpohe Ident cocation tab,aand look fora us "Workgroup:" label.ntan stliiWindows 2000:popmnpoue Control Panel and doubei-clickpohe SysteL icam. Clickpohe Network Ident cocation tab. Ths workgroup assa wslo appoar belowo us computcr assa.ntan stliiWindows XP:popmnpoue Control Panel inNC>".r c View mode and doubei-clickpohe SysteL icam. Thsn clickpohe Computcr Nssa tab.ntan stlii hp>Wr'eliuse ousohy t=>".rr,lonfbal">[te="]sttt> sherr inN he aext chapterpoo s taupiousoWindows clisbes. Foranow, you can complete us s tup bypperformien ousofollowien commandsoas root on youraUnix s Seou: man blockquota>".rr,code">#ohy t=>".rr,userinput">mkdir /usr/local/she l/tmpstbnnttt> #ohy t=>".rr,userinput">chmod 777 /usr/local/she l/tmpstbnnttt> p>You might alsoawan" oo putaaaf.ei ora wo in/oue hsmy=>".rr,f.leassa">/usr/local/she l/tmpstemnadiris ory sopthae after youraWindows systeLs areoiniti,lly configured, you wsloihave somethien foduse ooot>ickpohae neouythaen works. man p>Wepshould point outathat in/oerms of systeL security,athisais the worot = tup possi le. Foraoue momsbe, howneou, wr only wis ptoatist Sae l, soawr'elileave security outiof oueaais ure. In additaam, we wsloiencounper some encrypted pa.rword issuis wsth Windows clisbes latcr am, soathisa= tup wsloiafford us oue least amounp of headaches. man ndivcond dirsecb2"> t assas"she l2-CHP-2-SECT-6.1"/> nh3cond dirhead2">Encrypted P".rwordssth3> p>nt assas"INDEX-94"/nnt assas"INDEX-95"/nnt assas"INDEX-96"/nIfoyouroWindows clisbesperr usien Windows 98 oraWindows NT 4 S SeiceaPackp3 ar above (includien Windows 2000 and Windows XP)aand you err usien a eousaam of Sae loearliou than 3.0, you must addaoue followien entryaoo oue ny t=>".rr,lonfbal">[global]sttt> secbiam of oue Sae loconfigurataampfite: man blockquota>".rr,code">[global] encrypt pa.rwords = yes p>In additaam, you must usa/oue hsmy=>".rr,f.leassa">smba".rwdstemnnt assas"INDEX-97"/n program (oypically located in us diris orypnsmy=>".rr,f.leassa">/usr/local/she l/bin/ stemn) oo enper us userassa/pa.rword combinataams of oue Sae lousers into Sae l's encrypted pa.rword database. For example,oif youawan"ed oo allow Unixouser hy t=>".rr,lonfbal">stneosttt> toaaccess sherrs from a clisbe systeL, you would usa/ouisacommand: man blockquota>".rr,code">#ohy t=>".rr,userinput">smba".rwd -a stneostbnnttt> New SMB p".rword: Re ype new SMB p".rword: Addedpuser stneo. p>Wumnpoue f.rstouser isdadded, tue program wsloioutput a message sayien tha" oueaencrypted pa.rword databasepdoes not exist. Don't worry: itawieliouen crrate oue databasepfor you. Make sure tha" oueauserassa/pa.rword combinataams you eddaoo oue encrypted databasepmatch oueauserassasoend pa.rwords you intend oo use on us Windows clisbe side. You must run nsmy=>".rr,atShah b">smba".rwdstemn for eat> clisbe user. man p>In Sae lo3.0, pa.rwords err encrypted by defaacr,aso oue ny t=>".rr,lonfbal">encryptsttt> hy t=>".rr,lonfbal">p".rwordssttt> y t=>".rr,lonfbal">=sttt> hy t=>".rr,lonfbal">yes parameter in us configurataampfitepis optaamal. Howneou, you wsloistsloineed oo run the nsmy=>".rr,atShah b">smba".rwdstemn command oo eddausers oo oue encrypted pa.rword f.le.ntan htdiv> ndivcond dirsecb2"> t assas"she l2-CHP-2-SECT-6.2"/> nh3cond dirhead2">UsienoSWATsth3> p>nt assas"INDEX-98"/nCrrataen loconfigurataampfite wsth SWATpisaeven easiou than writien e configurataampfitepby hand. To invokeaSWAT,ouseoyour webabrowserpto connecb to nsmy=>".rr,atShah b">http://localhoot:901stemn, and lon o oas root wsth thearoot pa.rword, ad shown in ht hdd>s"ch02.html#she l2-CHP-2-FIG-1"BFigure 2-1. man divcond dirfigure"> t assas"she l2-CHP-2-FIG-1"/nnt assas"INDEX-99"/nnimg srcirfigs/she2_0201.gif"/nntdiv> p>After longaen in, clickpohe GLOBALSabutton atathe top of the screen. Youdshould see the Global Variabeis page shown in ht hdd>s"ch02.html#she l2-CHP-2-FIG-2"BFigure 2-2. man divcond dirfigure"> t assas"she l2-CHP-2-FIG-2"/nnimg srcirfigs/she2_0202.gif"/nntdiv> p>In uis example,onotice ouat SWATpretriivad the workgroup assa from the nsmy=>".rr,atShah b">smb.confstemn f.ei thae you crrated. (If it didn't, goabackpend perform ouat stepocorris ly.) Make sure tha" oueahy t=>".rr,lonfbal">security fieldiid see to hy t=>".rr,lonfbal">USERsttt>.ntan p>If you err runnien Sae lo2.2aaed youraWindows clisbesperr at least Windows 98 oraWindows NT 4 SPp3 ar latcr eousaams, find ny t=>".rr,lonfbal">encryptsttt> hy t=>".rr,lonfbal">p".rwordssttt> in us Security Optaams secbiam end selecb hy t=>".rr,lonfbal">yes. man p>Tus only ot e:Noptaamayou need oo chenge from oue msbupis onr determieaen whtt> systeL on us LAN re=olvis NetBIOS eddresses; ouis systeL is callcd the nsmy=>".rr,atShah b">WINS s Seoustemn. Atathe eouy bottomiof oueaaage, see tueahy t=>".rr,lonfbal">wiessttt> hy t=>".rr,lonfbal">support fieldito ny t=>".rr,lonfbal">Yes,ounless you elrrady have a WINS s Seou on youranetwork. Ifoyou do, putathe WINS s Seou's IP eddress in/oue hy t=>".rr,lonfbal">wiessttt>ahy t=>".rr,lonfbal">seSeousttt> fieldiinstead. Thsn returnooo ous top of the screen, and press ohe CommitaChengesabutton toowritso us chengesaoutato the nsmy=>".rr,atShah b">smb.confstemn f.ei. man p>Next, clickpohe SHARES icam. Youdshould see a page similar to nt hdd>s"ch02.html#she l2-CHP-2-FIG-3"BFigure 2-3. S lecb hy t=>".rr,lonfbal">teststtt> (to the right of oueaChooseoSherr button), and clickpohe ChooseoSherr button. You wiloisee the Sherr Parametero screen, ad shown in ht hdd>s"ch02.html#she l2-CHP-2-FIG-3"BFigure 2-3, wsth theahy t=>".rr,lonfbal">commeetsttt> and hy t=>".rr,lonfbal">aathsttt> fields f.lledainafrom your nsmy=>".rr,atShah b">smb.confstemn f.ei. man divcond dirfigure"> t assas"she l2-CHP-2-FIG-3"/nnimg srcirfigs/she2_0203.gif"/nntdiv> p>Ifoyou ssdh cied ouat youiwan" oo useaencrypted pa.rwordspo o us GLOBALSaaage, clickpohe PASSWORD button. Noar ous top of the screen, you wsloisee the S Seou P".rword Managemeet secbiam. Enper youraUnix userassaoend pa.rword inooueaspacis, and clickpohe Add New User button. Thisafuns aams oueasssa as the nsmy=>".rr,atShah b">smba".rwdstemn utalonyoand crrates en entryain/oue hsmy=>".rr,atShah b">/usr/local/she l/arivate/smba".rwdstemn f.ei to allow youdoo auouenticate from a Windows clisbe. man p>Now clickpohe VIEWabutton atathe top, and SWATpshows youdoue followien hsmy=>".rr,f.leassa">smb.confstemn fite: man blockquota>".rr,code"># Sae loconfigpfitepcrratedyusien SWAT # from localhoot (127.0.0.1) # Date: 2002/09/05 04:56:43 # Global parametero workgroup = METRAN encrypt pa.rwords = Yes wims supporto= Yes [te="] commeet = Fora esting only! patho= /usr/local/she l/tmp read only = No p>Onca/ouisaconfigurataampfitepis completed,ayou can skip theaaext step because ousooutput of SWATpisaguaranpeed oo be syntact c,ley corris . t assas"INDEX-100"/nntan htdiv> ndivcond dirsecb2"> t assas"she l2-CHP-2-SECT-6.3"/> nh3cond dirhead2">Disa ting Oplockssth3> p>The hsmy=>".rr,f.leassa">smb.confstemn t assas"INDEX-101"/nnt assas"INDEX-102"/> fitepyou have ju=" crratedyis cerpainey good enoug> fora us purpose of initi,la= tup and oesting, and you can usniitoas lostartien point from whtt> oo developooueaconfigurataampof youraaroductaampSae l s Seou. Butabrforr you gee too far wsth that, we wan" oo bring one uien fodyouraatpenbiam.ntan p>If you err the type of administrator who isahighly concerned about data integrity,ayou might wan" oo make oue followien mod cocation to yourahsmy=>".rr,f.leassa">smb.confstemn f.ei beforr con"aeuien: man blockquota>".rr,code">[global] oplocks = no p>Thatais,ouseolotext editor oo eddaoue lineahy t=>".rr,lonfbal">oplockssttt> y t=>".rr,lonfbal">=sttt> hy t=>".rr,lonfbal">no toaoue ny t=>".rr,lonfbal">[global]sttt> secbiam of your nsmy=>".rr,f.leassa">smb.confstemn f.ei. With this example,oas wsth ot e: examples we wsloipreseet turoug>outathis book,oyou do not need oo enper us ny t=>".rr,lonfbal">[global]sttt> lineaagain im your configurataampfite. Weoinclude itaoney oo indicate in whtt> secbiam oueaaarameter belongs. man p>Tus hy t=>".rr,lonfbal">oplockssttt> y t=>".rr,lonfbal">=sttt> hy t=>".rr,lonfbal">no aarameter disa tes opportunisticalockien by clisbes. Thisawsloiresacr inpsign cocantlyapoorrr performanci, but wsloihelpaensure ouat flakyaWindows clisbespend/or unreliabeiinetwork herdware wsloinot lead oo corrupted fieis on the Sae los Seou. man p>Wepwsloicoeou opportunisticalockien (oplocks) in morr detailain/oue secbiam "Locks and Oplocks" in ht hdd>s"ch08.html/pChapter 8, and recommend ouat you u derstand tus ideasipreseetcd theri beforr implemeetien a aroductaampSae los Seou ouat s Seos databasepfieis or ot e:Nvaluabeiidata.ntan htdiv> ndivcond dirsecb2"> t assas"she l2-CHP-2-SECT-6.4"/> nh3cond dirhead2">Testing oue ConfigurataampF.lesth3> p>nt assas"INDEX-103"/nIfoyou didn'touseoSWATpto crrate youraconfigurataampfite, youdshould aro a tyite=" itooo ensure ouat itais syntact c,ley corris . Itpmight seem siley oo run aite=" program against an eight-lineaconfigurataampfite,ibutait's good pract ceafora us rral ones ouat wr'loibe writien latcr am. man p>Tus te=" parser, nsmy=>".rr,f.leassa">te="parmstemn t assas"INDEX-104"/>, examones en nsmy=>".rr,f.leassa">smb.confstemn fitepforasyntax errors and reports any itpfindsoalong wsth a list of the s Seicesaeasbeed am youramachins. An example follows;ayou'loonotice ouat in our haste o gee ths s Seouprunnien we mistyped hy t=>".rr,lonfbal">workgroupsttt> ad hy t=>".rr,lonfbal">workgrpsttt> (tusooutput is ofpenoleagthy, soawr recommend capturien it wsth theahsmy=>".rr,atShah b">teestemnpcommand): man blockquota>".rr,code">Load smboconfigpfites from smb.conf Unknown aarameter encounpered: "workgrp" Ignorien unknown aarameter "workgrp" Processaen secbiam "[te="]" Loaded s SeicesafitepOK. Press Enper ooosee a dumppof youras Seiceadefinitiams # Global parametero [global] workgroup = WORKGROUP netbios assa = netbios aliases = s Seoupstrien = Sae lo2.2.6 inpedfacis = bind imterfacis only = No it=>".rr,loneannotataam">...(conpent omitted)... ntdiv> hdivcond dirsecb1"> t assas"she l2-CHP-2-SECT-7"/n nh2cond dirhead1">FirewaloiConfigurataamsth2n p>nt assas"INDEX-106"/nAs wsth anyas Seicesatha" run am TCP/IP, tue SMB networkaen seSeices offe:ed by Sae locan be accessed from acrosspohe Inpernetounless your organizataam's firrwaloiisoaroperly configured. Tue followien ports arrpusndiby Sae loforaSMB networkaen and SWAT: man dl> hdt>Porto137stbnntdt> hdd> p>UsedpforaNetBIOS network browsaen man stdd> hdt>Porto138stbnntdt> hdd> p>UsedpforaNetBIOS nssa seSeice man stdd> hdt>Porto139stbnntdt> hdd> p>Usedpforafitepand prinper sheraen and ot e:Noperataams man stdd> hdt>Porto445stbnntdt> hdd> p>Usedpby Windows 2000/XPiwumnpNetBIOS oeou TCP/IP is disa ted man stdd> hdt>Porto901stbnntdt> hdd> p>Usedpby SWATstan stdd> stdl> p>A" oueaminimum,ayour organizataam's Inpernet firrwaloishould shutadown aelioue ports inoouealist toaorafcocain bothydiris aams. Do not d dumeaouat areveetien incomien connecbiams is sufcocisbe; theri err cracksatha" orickpWindows clisbespinto sendien data outiof ouealocal erraonetwork aed into oue Inpernetoby SMB protocol,aeven from a local network tha" uses arivate IP eddresses not forwardedpby roupeds. Ifoyou wan" SMB orafcocatoaoravel acrosspohe Inpernetooo remotaysites,atheabe=" wayais toouseolovirtu,l arivate network (VPN). See theaO'Reiley book, nsmy=>".rr,citetitlo">Virtu,l Private Networksstemn,ofor morr informataam ampthis subjis . man p>In additaam, you might wis ptoaconfigure a firrwaloio o us Sae lohost systeL toakeep SMB p"ckets from oravelien furt e:Nthan necessary wsthin/youraorganizataam's network. For example, porto901ocan be shutadown for remotayaccesses sopthae SWATpcan be run only o o us Sae lohost systeL. Ifoyou err usien Sae lo o s Seo only a fract am of oue clisbe systeLs wsthin/youraorganizataam, consider allowien SMB p"ckets (i.e., p"ckets oniports 137-139 aed 445) oo go o oracosa fromaoney ouose clisbes. man p>For morr informataam oniconfigurien firrwalos,osee the O'Reiley book nsmy=>".rr,citetitlo">Buildien Inpernet Firewalosstemn. man ntdiv> hdivcond dirsecb1"> t assas"she l2-CHP-2-SECT-8"/n nh2cond dirhead1">Startien us Sae loDaemo ssth2n p>Two Sae loprocesses, nsmy=>".rr,atShah b">smbdstemnnt assas"INDEX-107"/n and nsmy=>".rr,atShah b">nmbdstemnnt assas"INDEX-108"/>, need oo be runnien foraSae lo o work corris ly. Tueri err threm ways o start them: man ul>Manuaelyntan stliiAutomat c,ley, duraen systeL bootntan stliiFrom nsmy=>".rr,atShah b">onetd oraxonetdstemnntan stlii ndivcond dirsecb2"> t assas"she l2-CHP-2-SECT-8.1"/> nh3cond dirhead2">Startien us Daemo s Manuaelynth3> p>nt assas"INDEX-109"/nnt assas"INDEX-110"/nIfoyou'rr inNa hurry, you can start the Sae lodaemo soby hand. As root,asimply enper ousofollowien commands: man blockquota>".rr,code">#ohy t=>".rr,userinput">/usr/local/she l/bin/smbd -Dstbnnttt> #ohy t=>".rr,userinput">/usr/local/she l/bin/nmbd -Dstbnnttt> p>Sae lowsloinow be runnien on yourasysteL aed is rrady toaaccept connecbiams. Howneou, keep in mind ouat if eit e:Nof oue daemo soexit foraanyarrason (includien systeL reboots), ouey wsloineed oo br restartrd manuaely.ntan htdiv> ndivcond dirsecb2"> t assas"she l2-CHP-2-SECT-8.2"/> nh3cond dirhead2">Automat c Startupnth3> p>nt assas"INDEX-111"/nnt assas"INDEX-112"/nTophave oheaSae lodaemo s startrd automat c,ley wumnpoue systeL boots, you need oo eddaoue commandsolioted in oue areviousosecbiam to/yourastandard Unixostartup scripts. Ths exact method earios dependien o o us flavor of Unix you'rr usien. man ndivcond dirsecb3"> t assas"she l2-CHP-2-SECT-8.2.1"/> nh3cond dirhead3">BSDaUnixnth3> p>nt assas"INDEX-113"/nnt assas"INDEX-114"/nnt assas"INDEX-115"/nWsth a BSD-stytepUnix, you need oo eppend ousofollowien codeato the nsmy=>".rr,f.leassa">rc.local stemnfite,iwhtt> is typically found in the hsmy=>".rr,f.leassa">/etcstemn or hsmy=>".rr,f.leassa">/etc/rc.dstemnadiris ories: man blockquota>".rr,code">if [ -x /usr/local/she l/bin/smbd]; tusn echo "Startien smbd..." aaaa/usr/local/she l/bin/smbd -D echo "Startien nmbd..." aaaa/usr/local/she l/bin/nmbd -D fi p>Thisacodeaisoeouyasimple: itat>icks ooosee if oue hsmy=>".rr,f.leassa">smbdstemn f.ei exists and has executrppermissaams, and if itadoes, it startsaupibothyof oue Sae lodaemo soam systeL boot. man ntdiv> hdivcond dirsecb3"> t assas"she l2-CHP-2-SECT-8.2.2"/> nh3cond dirhead3">SysteL VaUnixnth3> p>nt assas"INDEX-116"/nnt assas"INDEX-117"/nnt assas"INDEX-118"/nWsth SysteL V,athings can gee a littlo morr complex. Dependien o oyouraUnix eousaam,oyou might be a teito gee awayawsth makaen aasimple chenge to en nsmy=>".rr,f.leassa">rc.localstemn f.ei as wsth BSDaUnix,ibutaSysteL V oypically uses diris ories conpainien linksaoooscripts ouat control daemo soam oue systeL. Henci, you need oo instructpoue systeL how oo start end stop the Sae lodaemo s. Thm f.rstostepooo implemeet ouis is oo mod cyooueacontsbespof oue nsmy=>".rr,f.leassa">/etc/rc.d/init.dstemn diris orypby addien somethien similar to ousofollowien shell script, whtt> fora uis example we wsloinssa hsmy=>".rr,f.leassa">smb stemn: man blockquota>".rr,code">#!/bin/sh # C>ickpohae oue Sae loconfigurataampfite exists [ -f /usr/local/she l/lib/smb.conf ] ||oexit 0 start( ) { echo -n "Startien SMB seSeices: " aaaaaaaa/usr/local/she l/bin/smbd -D ERROR=$? echo echo -n "Startien NMB seSeices: " aaaaaaaa/usr/local/she l/bin/nmbd -D ERROR2=$? if [ $ERROR2 -ne 0 ] tusn ERROR=1 fi echo returno$ERROR } stop( ) { echo -n "Shuetien down SMB seSeices: " aaaaaaaa/bin/kiloi-TERM -a smbd ERROR=$? echo echo -n "Shuetien down NMB seSeices: " aaaaaaaa/bin/kiloi-TERM -a nmbd ERROR2=$? if [ $ERROR2 -ne 0 ] tusn ERROR=1 fi echo returno$ERROR } case "$1" in start) start ;; stop) stop ;; *) echo "Usage: $0 {start|stop}" aaaaaaaaexit 1 esac exit $? p>With this script, you can start end stop nsmy=>".rr,atShah b">smbdstemn and nsmy=>".rr,atShah b">nmbdstemn lika/ouis: man blockquota>".rr,code">#ohy t=>".rr,userinput">/etc/rc.d/init.d/smb startstbnnttt> Startien SMB seSeices: Startien NMB seSeices: #ohy t=>".rr,userinput">psdax | grep mbdstbnnttt> 1268 ?aaaaaaaaSaaaaaa0:00 /usr/local/she l/bin/smbd -D 1270 ?aaaaaaaaSaaaaaa0:00 /usr/local/she l/bin/nmbd -D 1465 pts/2aaaaSaaaaaa0:00 grep mbd #ohy t=>".rr,userinput">/etc/rc.d/init.d/smb stopstbnnttt> Shuetien down SMB seSeices: Shuetien down NMB seSeices: mare> p>If you err havien froubei writien e startup script for yourasysteL, t>ickpooosee if ouerrpis lopackaged release of Sae lo(availabei from youraUnix eondor oraoue Sae loFTPysite). Ifoso,oyou might be a teito extract e startup script from i" oo useaas lostartien point. Typically, this script doesn't chenge mut> (if at all) from release oo release, soausien a script from an older Sae l eousaam should not beoaapro teL. Anot e:Npossi alonyois toot>ickpohe hsmy=>".rr,f.leassa">packagaen memnadiris ory inooueaSae losourcl distributaam. Iniouat diris ory, theri err subdiris ories for many Unix eousaams in whtt> you can find e startup script for ouose eousaams. Evenaif youraeousaam isn't included, you can aro a tyifind e startup script for a similar eousaam oo useaas l startien point. man p>Finally, we need oo eddasymbolicalinksaooooue hsmy=>".rr,f.leassa">smbstemnpscriptain/oue hsmy=>".rr,atShah b">/etc/rc.d/rcX.dstemnadiris ories: man blockquota>".rr,code">#ohy t=>".rr,userinput">ln -s /etc/rc.d/init.d/smb /etc/rc.d/rc3.d/S35smbstbnnttt> #ohy t=>".rr,userinput">ln -s /etc/rc.d/init.d/smb /etc/rc.d/rc5.d/S35smbstbnnttt> #ohy t=>".rr,userinput">ln -s /etc/rc.d/init.d/smb /etc/rc.d/rc0.d/K35smbstbnnttt> #ohy t=>".rr,userinput">ln -s /etc/rc.d/init.d/smb /etc/rc.d/rc1.d/K35smbstbnnttt> #ohy t=>".rr,userinput">ln -s /etc/rc.d/init.d/smb /etc/rc.d/rc2.d/K35smbstbnnttt> #ohy t=>".rr,userinput">ln -s /etc/rc.d/init.d/smb /etc/rc.d/rc4.d/K35smbstbnnttt> #ohy t=>".rr,userinput">ln -s /etc/rc.d/init.d/smb /etc/rc.d/rc6.d/K35smbstbnnttt> p>The f.rsto wo commands, wsth link assasostartien wsth an "S", cause Sae lo o be startedawusn enperien runlevelsp3 ar 5, whtt> err the runlevelspin whtt> network f.leasheraen (NFS)ois normally ena ted. Ths s cond group of commands, wsth link assasostartien wsth a "K", cause Sae lo o be shutadown wumnpenperien anyaof oue ot e:Nrunlevelsp(0, 1, 2, 4, ar 6). man p>Tus linksastartien wsth "S" err usad todstart the daemo s,aand tusolinksastartien wsth "K" arrpusndifor kiloien ouem. Wumn the runlevel is changed, tue linksastartien wsth "K" impthe corrispondien diris ory (e.g., the nsmy=>".rr,f.leassa">rc3.dstemnadiris orypforarunlevel 3) err executrd,ofollowedpby tue linksastartien wsth "S". Ifowe wan"rd,owe could have Sae lorestartrd wumnpswstchien betwesnarunlevelsp3 and 5pby addien a hsmy=>".rr,f.leassa">K35smbstemn linkpoooeat> nsmy=>".rr,f.leassa">rc3.dstemn and nsmy=>".rr,f.leassa">rc5.d stemndiris ory. man p>Tus number after tue K ar S inoouealink assasois usad todsee tue order in whtt> eelioue daemo sowsth links inooueadiris oryperr startrd or kiloed off. Gee a loen listing of/oue hsmy=>".rr,atShah b">rc3.dstemnaor nsmy=>".rr,atShah b">rc5.dstemnadiris ories ooosee how ouisaisas taupion yourasysteL. Weouse 35 oo match oue behavior of Red Hat's Sae loRPMopackage. Tue importaet ouien isdoo make sure wumnpstartien Sae lo hae aloiseSeices it requiris areostartrd beforr it. Wumn shuttien down, itais a good idea todshutadown Sae lobeforr s Seicesait requiris oo evoidaexcess error messages inoouealog fites,abutathe order is not as crucial. man ntdiv> hdivcond dirsecb3"> t assas"she l2-CHP-2-SECT-8.2.3"/> nh3cond dirhead3">Darwim end Mac OS Xnth3> p>nt assas"INDEX-119"/nnt assas"INDEX-120"/nnt assas"INDEX-121"/nnt assas"INDEX-122"/>An instaelataoniof Sae lois bundlediwsth the Darwim distributaam,awhtt> isoincluded inoMac OS X.nt assas"FNPTR-5"/>nt hdd>s"#FOOTNOTE-5">[5] man p>Tus Sae lodaemo soereostartrd duraen systeL bootpby tue script hsmy=>".rr,f.leassa">/SysteL/Library/StartupIteLs/Sae l/She lstemn. To trigger tue execut am of ouis script, edit oueafiei hsmy=>".rr,f.leassa">/etc/hostconfigstemnoand chenge oue SMBSERVER aarameter oo look lika/ouis: man blockquota>".rr,code">SMBSERVER=-YES- p>OnoMac OS X, the graphicalouser imterfaci (GUI) provides an alpernatave oo usien the command lone. Launt> oueiSysteL Pdd>arences applicataam,aend selecb Sheraen (see ht hdd>s"ch02.html#she l2-CHP-2-FIG-4"BFigure 2-4). Under tue S Seicesatab,aturnoam Windows F.le Sheraen. Thisawsloimake tue aforrmenbiamed chenge to hsmy=>".rr,f.leassa">/etc/hostconfigstemnoand immediatelyaexecutrptue startup iteL. man divcond dirfigure"> t assas"she l2-CHP-2-FIG-4"/nnimg srcirfigs/she2_0204.gif"/nntdiv>arencessth4> p>Ifoyou decideato instaeliSae loyourselfoam Mac OS X, it's be=" not todstompoam oue instaelataoniprovided wsth theaOS. Use tue proceduresydetailed earliou in uis chapterpto instaelptue software into nsmy=>".rr,f.leassa">/usr/local/she lstemn or some ot e:Nerraounaffis edpby OS upgrades. (Rrmember oo s taupiusers wsth nsmy=>".rr,atShah b">smba".rwdstemn ifoyou'rr usien encrypted pa.rwords,oas described earliou in uis chapter. Thisastep isahandlediautomat c,ley wsth entriis in nsmy=>".rr,f.leassa">/var/db/she l/hashstemn ifoyou'rr usien the built-inps Seou on Mac OS X.) Onca/you've gotathat workaen, you can edit oueaSae lostartup iteLpscriptaoo refer oo/yourainstaelataon, lika/ouis: man blockquota>".rr,code">aaaa#!/bin/sh aaaa# Start Sae l aaaa. /etc/rc.common aaaaif [ "${SMBSERVER:=-NO-}" = "-YES-" ]; tusn Co soleMessage "Startien SMB seSeer" if [ -f /usr/local/she l/lib/smb.conf ]; tusn /usr/local/she l/bin/smbd -D aaaa/usr/local/she l/bin/nmbd -D fi fi p>Howneou, beware of OS updates,awhtt> can wipsoout yourachenges. One solut am isdoo make tue script immuta te, lika/ouis: man blockquota>".rr,code">#ohy t=>".rr,userinput">chflags uchg /SysteL/Library/StartupIteLs/Sae l/She lstbnnttt> ntdiv> hdivcond dirsecb3"> t assas"she l2-CHP-2-SECT-8.2.4"/> nh3cond dirhead3">Testing automat costartupnth3> p>nt assas"INDEX-123"/nnt assas"INDEX-124"/nIfoyou can afford a few minutes of downtisa, reboot yourasysteL aed again usa/oue hsmy=>".rr,atShah b">psstemn command oo c>ickpohae oue nsmy=>".rr,atShah b">smbdstemn and nsmy=>".rr,atShah b">nmbdstemn daemo soere runnien. And if you err managien a 24/7 seSeer,owe highly recommend ouat you find some downtisapin whtt> oo reboot end perform ouis t>ick. Ot e:wise, youranextounst>iduledidowntisapmight surpriseoyou wsth a mysteriousoabsenceiof SMB networkaen seSeices wumnpoue systeL comes up again! nt assas"INDEX-125"/nnt assas"INDEX-126"/nntan htdiv> ntdiv> ndivcond dirsecb2"> t assas"she l2-CHP-2-SECT-8.3"/> nh3cond dirhead2">Startien from inetdsth3> p>nt assas"INDEX-127"/nnt assas"INDEX-128"/nnt assas"INDEX-129"/nThs nsmy=>".rr,atShah b">onetdstemn nsmy=>".rr,atShah b">nt assas"FNPTR-6"/>nt hdd>s"#FOOTNOTE-6">[6] memn daemo ais a Unix systeL's Inpernet "supou daemo ." Itpliotens oniports defined in hsmy=>".rr,f.leassa">/etc/s Seicesstemn aedaexecutrspohe appropriate program for eat> port,awhtt> isodefined in hsmy=>".rr,f.leassa">/etc/onetd.confstemn. Ths advantage of ouis schesapis ouat you can have a largs number of daemo sorrady toaanswer queriis, butatheyidon't aloihave oo be runnien aelptue tisa. Instead, nsmy=>".rr,atShah b">onetdstemnpliotens foraconnecbiam requests end starts the appropriate daemo awumnpitais needed. Ths peaslnyois a smaloioeerheadacost of crrataen a new daemo aprocess,oas well as the fact ouat you need oo edit owopfites rat e:Nthan one todsee tuings up. Ths nsmy=>".rr,atShah b">onetdstemnpdaemo ais handyaif you have oney one ora wo Sae lousers or youramachins isdrunnien too manyodaemo s elrrady. It'sdalsoaeasiou to perform an upgrade wsthout disturbien an existienoconnecbiam.ntan p>If you wis ptoastart from nsmy=>".rr,f.leassa">onetdstemn, f.rstoopmn hsmy=>".rr,f.leassa">/etc/s Seicesstemn in/youratext editor. Ifoyou don't alrrady have ouem defined, addaoue followien wo lones: man blockquota>".rr,code">netbios-ssn 139/tcp netbios-ns 137/udp mare> p>Next, edit hsmy=>".rr,f.leassa">/etc/onetd.confstemn. Look fora us followien wo lones aed addaouem if oueyidon't exist. Ifoyou elrrady have hy t=>".rr,lonfbal">smbdsttt> and hy t=>".rr,lonfbal">nmbdsttt> lones in ousofite,iedit oueL toapoint ae oue new nsmy=>".rr,atShah b">smbdstemn and nsmy=>".rr,atShah b">nmbdstemn you've instaeled. Your braed of Unix might useaa slightly dif>arentasyntax in uis fite;iuse ousoexistienoentriis and ousonsmy=>".rr,f.leassa">onetd.conf stemn manuae page as loguide: man blockquota>".rr,code">netbios-ssn strraL tcp nowaitaroot /usr/local/she l/bin/smbd smbd netbios-ns dgram udp waita root /usr/local/she l/bin/nmbd nmbdstare> p>Finally, kiloianyonsmy=>".rr,atShah b">smbdstemn or nsmy=>".rr,atShah b">nmbdstemnoprocessesaend send tus nsmy=>".rr,atShah b">onetdstemnpprocesspa hengup (HUP) signalptoatiloiit oo reread ies configurataam fite: man blockquota>".rr,code"># hy t=>".rr,userinput">/bin/kiloi-TERM -a smbdstbnnttt> #ohy t=>".rr,userinput">/bin/kiloi-TERM -a nmbdstbnnttt> #ohy t=>".rr,userinput">/bin/kiloi-HUP -a onetdstbnnttt> mare> p>After tuat, Sae loshould be up and runnien.ntan p>As we've pointed outabrforr, Red Hat end perhaps ot e:NUnix eondors supply hsmy=>".rr,atShah b">xonetdstemn rat e:Nthan nsmy=>".rr,atShah b">onetdstemn. Ifoyou need oo usa hsmy=>".rr,atShah b">xonetdstemn, you wsloineed oo supply a configurataam f.ei in the hsmy=>".rr,atShah b">/etc/xonetd.dstemnadiris ory. t assas"INDEX-130"/nntan htdiv> ntdiv> hdivcond dirsecb1"> t assas"she l2-CHP-2-SECT-9"/n nh2cond dirhead1">Testing oue Sae loDaemo ssth2n p> t assas"INDEX-131"/nnt assas"INDEX-132"/>We'rr nearlyidone wsth theaSae los Seoup= tup. Aelptuat's leftaoo do isdoo make sure neouythaen isdworkaen as we thinkiit should. A coneonisbe wayaoo do thisais to usa/oue hsmy=>".rr,f.leassa">smbclisbestemnnt assas"INDEX-133"/n program oo examoneawua" oueas Seoupis offe:ien fodtheaaetwork. Ifoneouythaen isds taupiaroperly, you should be a teito do thsofollowien: man blockquota>".rr,code">#ohy t=>".rr,userinput">/usr/local/she l/bin/smbclisbe -U% -L localhootstbnnttt> added imterfaci ip=172.16.1.1 bcast=172.16.1.255 nmask=255.255.255.0 Domain=[METRAN] OS=[Unix] S Seou=[Sae lo2.2.6] Sherrnssa Type Commeet --------- ---- ------- te=" Disk Fora esting only, please IPC$ IPC IPC S Seicea(Sae lo2.2.6) ADMIN$ Disk IPC S Seicea(Sae lo2.2.6) S Seoup Commeet --------- ------- TOLTECp Sae lo2.2.6oam ooltec Workgroup Master --------- ------- METRAN TOLTEC mare> p>If ouerrpis lopro teL,idon't panic! Tryaoo start the daemo somanuaely, and c>ickpohe systeL output or tue debugpfites at hsmy=>".rr,f.leassa">/usr/local/she l/var/log.smbstemnnt assas"INDEX-134"/nnt assas"INDEX-135"/nnt assas"INDEX-136"/>pooosee if you can determieeawua" heppened. Ifoyou thinkiit might be a morr seriousopro teL,iskip to nt hdd>s"ch12.html/pChapter 12 forahelpaam oroubeishooting oue Sae lodaemo s.ntan p>If it worked, congratulataons! Youdnow have successfuley s taupious Sae los Seoupwsth a disk sherr. It'sdaasimple one, butawe can usniitooo s taupiand oest us Windows 95/98/Me and NT/2000/XPiclisbespin theaaext chapter. Then we wsloistart makaen it morr interestingaby addien seSeices sut> as home diris ories, prinpers,aend security,aand by s eien how oo integrate oue s Seou into e largsraWindows domain. nt assas"INDEX-137"/nntan htdiv>


blockquota> p> t hdd>s"#FNPTR-1">[1] smy=>".rr,atShah b">gccstemn binariis ari evailabei for almost neouy modernamachins. See t hdd>s"http://www.gnu.org/">http://www.gnu.org/ foraa list of sites wsth smy=>".rr,atShah b">gccstemn and ot e:NGNU software.ntan p> t hdd>s"#FNPTR-2">[2] Do not confusa/ouisawsth theaSolarisa smy=>".rr,atShah b">kiloaelstemn command,awhtt> performs p"rt of oue systeL shutdown sequence!ntan st assas"FOOTNOTE-3"/> p> t hdd>s"#FNPTR-3">[3] Dependien o o us eousaam of hsmy=>".rr,atShah b">xonetdstemn you have and how it was compiled,oyou might need oo send e USR1 or some ot e:Nsignalprat e:Nthan us HUP signal. C>ickpoheomanuae page for nsmy=>".rr,atShah b">xonetd (8)stemn on yourasysteL foradetails.ntan st assas"FOOTNOTE-4"/> p> t hdd>s"#FNPTR-4">[4] Ifoyou did not compile Sae l, butainstead downloaded a binary, t>ickpwsth theadocumeetataam fora us packagedoo find outawuerrpit exaecbs the nsmy=>".rr,f.leassa">smb.confstemn f.ei to be. Or, tryarunnien theahsmy=>".rr,atShah b">te="parmstemn program and look fora us locataam af nsmy=>".rr,f.leassa">smb.confstemn inpoue f.rstolineaaf output. If Sae locame areinstaeledpwsth youraUnix systeL, en nsmy=>".rr,f.leassa">smb.confstemn fitepisoaro a tyielrrady somewuerrpam yourasysteL.ntan p> t hdd>s"#FNPTR-5">[5] In uis book,owe coeoupDarwim Vousaam 6.0 and OS XaVousaam 10.2.ntan p> t hdd>s"#FNPTR-6">[6] With earlyireleasesiof Sae lo2.2, theri weri reports of intermitpenb errors wumnpstartien from nsmy=>".rr,atShah b">onetdstemn. Weiprovide thisainformataam sopthae itawielibi evailabei for latcr releasesiwumnpoue pro teL wsloihopefuley have besnaident coed and corris ed.ntan nhr/>s"toc.html/pTOC mh4> mhtml>